package cn.xz.hfsk.adapter

import cn.xz.hfsk.R
import cn.xz.hfsk.bean.AreaList
import cn.xz.hfsk.widgets.XZTextView
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.module.LoadMoreModule
import com.chad.library.adapter.base.viewholder.BaseViewHolder

/**
 * 设备列表分类适配器*/
class DeviceTAdapter: BaseQuickAdapter<AreaList, BaseViewHolder>(R.layout.item_device_t), LoadMoreModule {

    override fun convert(holder: BaseViewHolder, item: AreaList) {
        //只有第一条显示占位图
        if (holder.adapterPosition == 0) {
            holder.setVisible(R.id.view_zw, true)
        } else {
            holder.setGone(R.id.view_zw, true)
        }

        val tvLightTxt = holder.getView<XZTextView>(R.id.tv_area_item)
        tvLightTxt.text = item.name.toString()
        tvLightTxt.isSelected = item.select
    }
}